/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package Wires.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

import Wires.InputFormalParameter;
import Wires.LibraryRef;
import Wires.OutputFormalParameter;
import Wires.TransformationType;
import Wires.WiresPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Transformation Type</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link Wires.impl.TransformationTypeImpl#getOutParams <em>Out Params</em>}</li>
 *   <li>{@link Wires.impl.TransformationTypeImpl#getLibraries <em>Libraries</em>}</li>
 *   <li>{@link Wires.impl.TransformationTypeImpl#getInParams <em>In Params</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public abstract class TransformationTypeImpl extends TypeImpl implements TransformationType {
	/**
	 * The cached value of the '{@link #getOutParams() <em>Out Params</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getOutParams()
	 * @generated
	 * @ordered
	 */
	protected EList<OutputFormalParameter> outParams;

	/**
	 * The cached value of the '{@link #getLibraries() <em>Libraries</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLibraries()
	 * @generated
	 * @ordered
	 */
	protected EList<LibraryRef> libraries;

	/**
	 * The cached value of the '{@link #getInParams() <em>In Params</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getInParams()
	 * @generated
	 * @ordered
	 */
	protected EList<InputFormalParameter> inParams;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected TransformationTypeImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return WiresPackage.Literals.TRANSFORMATION_TYPE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<OutputFormalParameter> getOutParams() {
		if (outParams == null) {
			outParams = new EObjectContainmentEList<OutputFormalParameter>(OutputFormalParameter.class, this, WiresPackage.TRANSFORMATION_TYPE__OUT_PARAMS);
		}
		return outParams;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<LibraryRef> getLibraries() {
		if (libraries == null) {
			libraries = new EObjectContainmentEList<LibraryRef>(LibraryRef.class, this, WiresPackage.TRANSFORMATION_TYPE__LIBRARIES);
		}
		return libraries;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<InputFormalParameter> getInParams() {
		if (inParams == null) {
			inParams = new EObjectContainmentEList<InputFormalParameter>(InputFormalParameter.class, this, WiresPackage.TRANSFORMATION_TYPE__IN_PARAMS);
		}
		return inParams;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case WiresPackage.TRANSFORMATION_TYPE__OUT_PARAMS:
				return ((InternalEList<?>)getOutParams()).basicRemove(otherEnd, msgs);
			case WiresPackage.TRANSFORMATION_TYPE__LIBRARIES:
				return ((InternalEList<?>)getLibraries()).basicRemove(otherEnd, msgs);
			case WiresPackage.TRANSFORMATION_TYPE__IN_PARAMS:
				return ((InternalEList<?>)getInParams()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case WiresPackage.TRANSFORMATION_TYPE__OUT_PARAMS:
				return getOutParams();
			case WiresPackage.TRANSFORMATION_TYPE__LIBRARIES:
				return getLibraries();
			case WiresPackage.TRANSFORMATION_TYPE__IN_PARAMS:
				return getInParams();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case WiresPackage.TRANSFORMATION_TYPE__OUT_PARAMS:
				getOutParams().clear();
				getOutParams().addAll((Collection<? extends OutputFormalParameter>)newValue);
				return;
			case WiresPackage.TRANSFORMATION_TYPE__LIBRARIES:
				getLibraries().clear();
				getLibraries().addAll((Collection<? extends LibraryRef>)newValue);
				return;
			case WiresPackage.TRANSFORMATION_TYPE__IN_PARAMS:
				getInParams().clear();
				getInParams().addAll((Collection<? extends InputFormalParameter>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case WiresPackage.TRANSFORMATION_TYPE__OUT_PARAMS:
				getOutParams().clear();
				return;
			case WiresPackage.TRANSFORMATION_TYPE__LIBRARIES:
				getLibraries().clear();
				return;
			case WiresPackage.TRANSFORMATION_TYPE__IN_PARAMS:
				getInParams().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case WiresPackage.TRANSFORMATION_TYPE__OUT_PARAMS:
				return outParams != null && !outParams.isEmpty();
			case WiresPackage.TRANSFORMATION_TYPE__LIBRARIES:
				return libraries != null && !libraries.isEmpty();
			case WiresPackage.TRANSFORMATION_TYPE__IN_PARAMS:
				return inParams != null && !inParams.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //TransformationTypeImpl
